<template>
    <div>
      <van-nav-bar
        :title="title"
        :left-arrow="leftArrow"
        :right-text="rightText"
        @click-left="onClickLeft"
      />
    </div>
  </template>
    
    <script>
  import { NavBar } from "vant";
  export default {
    name: "mineReturn",
    components: {
      VanNavBar: NavBar,
    },
    props: {
      title: {
        type: String,
        default: "",
      },
      leftArrow: {
        type: Boolean,
        default: true,
      },
      rightText:{
        type:String,
        default:''
      }
    },
    methods: {
      onClickLeft() {
       const currentPath =  this.$route.path
       const newPath = currentPath.substring(0 ,currentPath.lastIndexOf('/'))
       this.$router.push(newPath)
      },
    },
  };
  </script>